package cn.base.demo2;

import java.util.Scanner;

public class Code09 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("购物清单：");
        System.out.println("1. 宁夏黑枸杞(价格: 30, 数量: 2)");
        System.out.println("2. 罗汉果茶(价格: 20, 数量: 1)");
        System.out.println("-----------------------------------");
        System.out.println("请输入您的选择:");
        System.out.println("1. 结算所有");
        System.out.println("2. 结算单个");
        int selection = sc.nextInt();
        if (selection == 1) {
            System.out.println("结算成功您已支付" + (double) (30 * 2 + 20) + "元");
        } else if (selection == 2) {
            System.out.println("请输入您要结算的商品  1. 宁夏黑枸杞   2. 罗汉果茶");
            int select = sc.nextInt();
            if (select == 1) {
                System.out.println("结算成功您已支付" + (double) 30 * 2 + "元");
            } else if (select == 2) {
                System.out.println("结算成功您已支付" + (double) 20 + "元");
            }
        }


    }
}
